package com.designpatternspart2.behavioraldesignpatterns.strategypattern;

/**
 *
 * @author Lance
 */
public class Context
{

    private int temperatureInF;
    private Strategy strategy;

    public Context(int temperatureInF, Strategy strategy)
    {
        this.temperatureInF = temperatureInF;
        this.strategy = strategy;
    }

    public void setStrategy(Strategy strategy)
    {
        this.strategy = strategy;
    }

    public int getTemperatureInF()
    {
        return temperatureInF;
    }

    public boolean getResult()
    {
        return getStrategy().checkTemperature(getTemperatureInF());
    }

    public void setTemperatureInF(int temperatureInF)
    {
        this.temperatureInF = temperatureInF;
    }

    public Strategy getStrategy()
    {
        return strategy;
    }
}
